class ClassA():
    def __init__(self):
        print('object born,id:%s' % str(hex(id(self))))

    def __del__(self):
        print('object del,id:%s' % str(hex(id(self))))


def f1():
    while True:
        c1 = ClassA()
        del c1


import sys
import gc
list1 = []

a = ClassA()
b = a
list1.append(a)
print(sys.getrefcount(a))
# b = 1
del b
# list1.remove(a)
print(sys.getrefcount(a))
# f1()
print(gc.garbage)
print(gc.get_count())
print(gc.get_stats())
print(gc.collect())
print(gc.set_debug(True))